<#include "admin/common/include/html_head.html"> <#include
"admin/common/include/sysparam.html"> <#include
"admin/common/include/pagination.html">
<div class="row-fluid">
	<div class="span12">
		<!-- BEGIN EXAMPLE TABLE PORTLET-->
		<div class="portlet box">

			<div class="portlet-title">
				<div class="caption">
					<h5>栏目列表</h5>
				</div>
			</div>
			<div class="portlet-body form">
				<form id="bannerSearchForm">
					<div class="row-fluid">
						<div class="span6">
							<div class="dataTables_filter" id="sample_1_filter">
								<label>名称: <input type="text" aria-controls="sample_1"
									value="${_QUERY_s_eq_name}" class="span1 m-wrap medium"
									name="_QUERY_s_eq_name" id="_QUERY_s_eq_name"></label>
							</div>
						</div>
						<div class="span6">
							<div class="dataTables_filter" id="sample_1_filter">
								<label>组key: <@select paramCode=groupKeyCode
									value=(_QUERY_s_eq_groupKey)?if_exists item='
									name="_QUERY_s_eq_groupKey"'/></label>
							</div>
						</div>
					</div>
					<div class="row-fluid">
						<div class="span6">
							<div class="dataTables_filter" id="sample_1_filter">
								<label>是否有效: <@select paramCode=iseffCode
									value=(_QUERY_n_eq_iseff)?if_exists item='
									name="_QUERY_n_eq_iseff"'/></label>
							</div>
						</div>

					</div>
				</form>

				<div class="alert alert-error " id="errTip" style="display: none;"></div>
				<div class="alert alert-success " id="sucTip" style="display: none;"></div>
				<div class="tab-pane active" id="tab_1">
					<div class="portlet-body">
						<div class="clearfix">
							<button id="banner_query_btn" class="btn blue">
								<i class="icon-search"></i>&nbsp;&nbsp;查询
							</button>
							<button id="banner_add_btn" class="btn blue">
								<i class="icon-plus"></i>&nbsp;&nbsp;新增
							</button>
							<button id="banner_del_btn" class="btn blue">
								<i class="icon-trash"></i>&nbsp;&nbsp;删除
							</button>
						<!-- 	<button id="banner_bindres_btn" class="btn blue">
								<i class="icon-long-arrow-right"></i>&nbsp;&nbsp;绑定资源
							</button>
 -->
						</div>
						<br>
						<form action="${_contextPath}/Admin-Banner-show.action"
							id="QueryForm">
							<table class="table table-striped table-bordered table-hover"
								id="bannerTable">
								<thead>
									<tr>
										<th style="width: 8px;"><input type="checkbox"
											class="group-checkable" data-set="#bannerTable .checkboxes" /></th>
										<th>分组</th> 
										<th>名称</th>
										<th>链接</th>
										<th>图标</th>
									 
										<th>排位</th>
										<th>是否有效</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<#list pageBean.result as nav >
									<tr class="odd gradeX">
										<td><input type="checkbox" class="checkboxes"
											value="${nav.id}" /></td>
										<td>${nav.groupKey}</td>
										<td>${nav.name}</td>
										<td>${nav.linkUrl}</td>
									 	 <td><#if nav?? && nav.imageUrl ?? >
									 	  <img src="${contextPath}${(nav.imageUrl)?if_exists}"
														width="80" height="80" />
														</#if> </td> 
										<td>${nav.rank}</td>
										<td><@translate paramCode=iseffCode
											value=(nav.iseff)?if_exists /></td>
										<td><a href='#' name="edit_action" value="${nav.id}"><i
												class="icon-edit"></i></a></td>
									<tr></#list>
								</tbody>
							</table>
						</form>
						<@pagination searchFormId='bannerSearchForm' pBean=pageBean />
					</div>
				</div>

			</div>
		</div>
		<!-- END EXAMPLE TABLE PORTLET-->
	</div>
</div>
</div>

<script>
	jQuery(document)
			.ready(
					function() {
						tableAction
								.init({
									tableId : 'bannerTable',
									queryUrl : '${contextPath}/Admin-Banner-show.action',
									deleteUrl : '${contextPath}/Admin-Banner-delete.action',
									editUrl : '${contextPath}/Admin-Banner-showEditForm.action',
									queryBtnId : 'banner_query_btn',
									deleteBtnId : 'banner_del_btn',
									editBtnId : 'banner_add_btn', 
									isPopEditForm: false,
									searchFormId : 'bannerSearchForm'
								});

						/* //绑定资源按钮事件
						$('#banner_bindres_btn')
								.bind(
										'click',
										function() {
											var selectItems = tableMng
													.selectItem('bannerTable');
											if (selectItems.length == 0) {
												common.alert({
													content : '请选中需要操作的项！'
												});
												return;
											}
											var url = '${contextPath}/Admin-Banner-showResList.action?categoryId='
													+ selectItems;
											mainFrame.addContainer(url);
										}); */
					});
</script>
